/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 * <p>Project: jdbc - Demo2
 * <p>Powered by jiangbo On 2023-02-13
 * 11:29:02
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Demo2 {
    public static void main(String[] args) throws Exception {
    Class.forName("com.mysql.jdbc.Driver");
       Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/zhao?useUnicode=true&characterEncoding=utf-8","root","123456");
        Statement st = conn.createStatement();
        //String sql ="insert into zhao value(9,'不喜欢')";
        String sql= " delete zhao from zhao where id='8'";
        //String sql= " update zhao set name='dddddd' where id=9";
        int i = st.executeUpdate(sql);
        if(i>0){
            System.out.println("连接成功！");
        }else {
            System.out.println("连接失败！");
        }
        System.out.println(i);
        conn.close();
        st.close();
    }



}


